
class EnvironmentRecords {
    constructor(bindings) {
        this.bindings = bindings || {};
    }
    createBinding(N) {
        this.bindings[N] = undefined;
    }
    setBinding(N, V) {
        this.bindings[N] = V;
    }
    hasBinding(N) {
        return N in this.bindings;
    }
    getBindingValue(N) {
        let value = this.bindings[N];
        if ((value.type === 'let' || value.type === 'const') && value.uninitialized) {
            throw new Error(`ReferenceError: Cannot access '${N} before initialized`);
        }
        return this.bindings[N];
    }
}
module.exports = EnvironmentRecords;